package com.insigma.business.qrcode.soldier.controller;

import com.insigma.business.qrcode.common.annotation.ApiServiceType;
import com.insigma.business.qrcode.common.dto.CommonQaInfoDTO;
import com.insigma.business.qrcode.common.dto.CommonQaInfoInsertRequest;
import com.insigma.business.qrcode.common.dto.CommonQaInfoSearchRequest;
import com.insigma.business.qrcode.common.template.BasePagingResponse;
import com.insigma.business.qrcode.common.vo.BaseDeleteRequest;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.soldier._bff.CommonQaInfoBFFProvider;
import com.insigma.business.qrcode.soldier._bff.PlacementSoldierInfoBFFProvider;
import com.insigma.business.qrcode.soldier._bff.SoldierMessageInfoBFFProvider;
import com.insigma.business.qrcode.soldier.dto.PlacementBatchDTO;
import com.insigma.business.qrcode.soldier.dto.PlacementSoldierInfoDTO;
import com.insigma.business.qrcode.soldier.dto.SoldierMessageInfoDTO;
import com.insigma.business.qrcode.soldier.request.BaseGetRequest;
import com.insigma.business.qrcode.soldier.request.CommonQaInfoUpdateRequest;
import com.insigma.business.qrcode.soldier.request.PlacementInfoSearchRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@Slf4j
@Api(value = "老兵 码上知识库")
@RequestMapping("/web/soldierKnowledge")
@RestController("soldierKnowledgeController")
public class SoldierKnowledgeController {

    @Resource
    PlacementSoldierInfoBFFProvider placementSoldierInfoBFFProvider;

    @Resource
    SoldierMessageInfoBFFProvider soldierMessageInfoBFFProvider;

    @Resource
    CommonQaInfoBFFProvider commonQaInfoBFFProvider;

    @PostMapping("/searchCommonQaInfoOfSoldier")
    @ApiOperation("FAQ维护 - 查询问题数据列表")
    public BasePagingResponse<List<CommonQaInfoDTO>> searchCommonQaInfoOfSoldier(@RequestBody CommonQaInfoSearchRequest commonQaInfoSearchRequest){
        return commonQaInfoBFFProvider.searchCommonQaInfoOfSoldier(commonQaInfoSearchRequest);
    }

    @PostMapping("/searchCommonQaInfo")
    @ApiOperation("FAQ维护 - 查询数据列表")
    public BasePagingResponse<List<CommonQaInfoDTO>> searchCommonQaInfo(@RequestBody CommonQaInfoSearchRequest commonQaInfoSearchRequest){
        return commonQaInfoBFFProvider.searchCommonQaInfo(commonQaInfoSearchRequest);
    }


    @PostMapping("/getCommonQaInfo")
    @ApiOperation("FAQ维护 - 得到合法的非逻辑删除对象")
    public BaseResponse<CommonQaInfoDTO> getCommonQaInfo(@RequestBody BaseGetRequest baseGetRequest){
        return commonQaInfoBFFProvider.getCommonQaInfo(baseGetRequest);
    }

    @PostMapping("/insertCommonQaInfo")
    @ApiOperation("FAQ维护 - 插入数据")
    public BaseResponse<String> insertCommonQaInfo(@RequestBody CommonQaInfoInsertRequest commonQaInfoInsertRequest){
        return commonQaInfoBFFProvider.insertCommonQaInfo(commonQaInfoInsertRequest);
    }

    @PostMapping("/updateCommonQaInfo")
    @ApiOperation("FAQ维护 - 更新数据")
    public BaseResponse<Integer> updateCommonQaInfo(@RequestBody CommonQaInfoUpdateRequest commonQaInfoUpdateRequest){
        return commonQaInfoBFFProvider.updateCommonQaInfo(commonQaInfoUpdateRequest);
    }

    @PostMapping("/deleteCommonQaInfo")
    @ApiOperation("FAQ维护 - 删除数据")
    public BaseResponse<Integer> deleteCommonQaInfo(@RequestBody BaseDeleteRequest deleteRequest){
        return commonQaInfoBFFProvider.deleteCommonQaInfo(deleteRequest);
    }





}
